package com.quanyan.operative.service.impl;

import com.quanyan.operative.mapper.UserBlessExtendMapper;
import com.quanyan.operative.model.req.ReqBlessingUser;
import com.quanyan.operative.model.resp.RespBlessingUser;
import com.quanyan.operative.service.BlessingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by zhang on 16/11/5.
 */
@Service
public class BlessingServiceImpl implements BlessingService {

    @Autowired
    private UserBlessExtendMapper userBlessExtendMapper;
    @Override
    public List<RespBlessingUser> getUserBlessingList(ReqBlessingUser reqBlessingUser) {
        userBlessExtendMapper.insertUserBless(reqBlessingUser);
        Integer uid = reqBlessingUser.getUid();
        Map map = new HashMap<>();
        map.put("uid",uid);
        List<RespBlessingUser> list = userBlessExtendMapper.getBlessingUserList(map);
        return list;
    }
}
